package world.ztomorrow.novel.service;


import org.springframework.stereotype.Service;
import world.ztomorrow.common.dto.PageReqDto;
import world.ztomorrow.common.dto.PageRespDto;
import world.ztomorrow.common.dto.RestResp;
import world.ztomorrow.novel.dao.po.BookInfo;
import world.ztomorrow.novel.dto.req.BookAddReqDto;
import world.ztomorrow.novel.dto.req.ChapterAddReqDto;
import world.ztomorrow.novel.dto.req.ChapterUpdateReqDto;
import world.ztomorrow.novel.dto.req.UserCommentReqDto;
import world.ztomorrow.novel.dto.resp.*;

import java.security.NoSuchAlgorithmException;
import java.util.List;

@Service
public interface BookService {
    List<BookInfo> listRankBooks(String orderKey);

    RestResp<List<BookCategoryRespDto>> listCategory(Integer workDirection);

    RestResp<BookInfoRespDto> getBookById(Long bookId);

    RestResp<List<BookInfoRespDto>> listRecBooks(Long bookId) throws NoSuchAlgorithmException;

    RestResp<BookChapterAboutRespDto> getLastChapterAbout(Long bookId);

    RestResp<List<BookChapterRespDto>> listChapters(Long bookId);

    RestResp<BookCommentRespDto> listNewestComments(Long bookId);

    RestResp<Void> saveComment(UserCommentReqDto dto);

    RestResp<Void> updateComment(Long userId, Long id, String content);

    RestResp<Void> deleteComment(Long userId, Long id);

    RestResp<Void> addVisitCount(Long bookId);

    RestResp<BookContentAboutRespDto> getBookContentAbout(Long chapterId);

    RestResp<String> getPreChapterId(Long chapterId);

    RestResp<String> getNextChapterId(Long chapterId);

    RestResp<PageRespDto<BookInfoRespDto>> listAuthorBooks(PageReqDto dto);

    RestResp<Void> saveBookChapter(ChapterAddReqDto dto);

    RestResp<Void> deleteBookChapter(Long chapterId);

    RestResp<ChapterContentRespDto> getBookChapter(Long chapterId);

    RestResp<Void> updateBookChapter(Long chapterId, ChapterUpdateReqDto dto);

    RestResp<PageRespDto<BookChapterRespDto>> listBookChapters(Long bookId, PageReqDto dto);

    RestResp<Void> saveBook(BookAddReqDto dto);

    List<BookInfo> listHomeBooks(List<Long> ids);

}
